﻿using Teigha.Core;
using Teigha.TD;

namespace SmartPlant.CADView
{
    public class OdExCustomServices : ExHostAppServices
    {
        public override string fileDialog(int flags, string dialogCaption, string defExt, string defFilename, string filter)
        {
            var dlg = new Microsoft.Win32.SaveFileDialog
            {
                DefaultExt = defExt,
                Title = dialogCaption,
                FileName = defFilename,
                Filter = filter
            };

            if (dlg.ShowDialog() == true)
            {
                return dlg.FileName;
            }
            throw new OdEdCancel();
        }
    }
}
